;;; init-binding --- binding key
;;; Commentary:
;;; Code:

;; command
(leader-key "SPC" '(execute-extended-command :wk "M-x")) ;; 调用M-x

;; file
(leader-key
  "f" '(:ignore t :wk "file")
  "f." '(my/open-init-file :wk "init.el")
  "fa" '(align-regexp :wk "align")
  "ff" '(find-file :wk "find")
  "fo" '(consult-outline :wk "outline")
  "fc" '(dired-create-empty-file :wk "create")
  "fd" '(dired-create-directory :wk "create dir")
  "fs" '(save-buffer :wk "save")
  "fr" '(ranger :wk "ranger")
  "ft" '(dired :wk "dired")
  "fm" '(follow-mode :wk "follow")
  "fe" '(ediff :wk "diff")
  "fS" '(my/save-all-buffers :wk "save all")
  "fg" '(consult-goto-line :wk "goto line")
  "fR" '(rename-file :wk "rename")
  )

;; buffer
(leader-key
  "b" '(:ignore t :wk "buffer & bookmark")
  "b1" '(my/kill-other-buffers :wk "kill other")
  "bb" '(consult-buffer :wk "list")
  "bd" '(evil-delete-buffer :wk "delete")
  "bn" '(evil-next-buffer :wk "next")
  "bp" '(evil-prev-buffer :wk "prev")
  "bc" '(evil-buffer-new :wk "create")
  "bm" '(consult-bookmark :wk "list bookmarks")
  "br" '(bookmark-delete :wk "delete bookmark")
  )

;; comment
(leader-key
  "c" '(:ignore t :wk "comment")
  "cc" '(comment-or-uncomment :wk "comment")
  "cr" '(comment-or-uncomment-region :wk "comment region")
  )

;; docker & k8s
(leader-key
  "d" '(:ignore t :wk "docker")
  "dd" '(docker :wk "docker")
  "dc" '(docker-compose :wk "compose")
  "dk" '(kubernetes-overview :wk "kubernetes")
  )

;; git
(leader-key
  "g" '(:ignore t :wk "git")
  "gs" '(magit-status :wk "status")
  "gg" '(magit-dispatch :wk "dispatch")
  "gv" '(git-timemachine-toggle :wk "timemachine")
  "gr" '(consult-git-grep :wk "grep")
  )

;; windows
(leader-key
  "w" '(:ignore t :wk "window")
  "w1" '(delete-other-windows :wk "delete other")
  "wu" '(winner-undo :wk "undo")
  "wr" '(winner-redo :wk "redo")
  "ws" '(evil-window-split :wk "split")
  "wv" '(evil-window-vsplit :wk "vsplit")
  "wd" '(evil-window-delete :wk "delete")
  "wh" '(evil-window-left :wk "left")
  "wj" '(evil-window-down :wk "bottom")
  "wk" '(evil-window-up :wk "up")
  "wl" '(evil-window-right :wk "right")
  "wo" '(other-window :wk "other")
  "wf" '(toggle-frame-fullscreen :wk "fullscreen")
  "ww" '(zoom-window-zoom :wk "zoom")
  )

;; search
(leader-key
  "s" '(:ignore t :wk "search")
  "ss" '(consult-ripgrep :wk "ripgrep")
  "sl" '(consult-line :wk "line")
  "sL" '(consult-line-multi :wk "line multi")
  "sr" '(rg-menu :wk "ripgrep")
  "si" '(consult-imenu :wk "imenu")
  "sI" '(consult-imenu-multi :wk "imenu multi")
  )

;; project
(leader-key
  "p" '(:ignore t :wk "project")
  "pp" '(consult-dir :wk "switch")
  "pa" '(projectile-add-known-project :wk "add")
  )

;; org
(leader-key
  "o" '(:ignore t :wk "org")
  "oo" '(consult-org-agenda :wk "agendas")
  "oa" '(org-agenda :wk "agenda")
  "oc" '(org-capture :wk "capture")
  "ob" '(org-switchb :wk "switchb")
  ;; "ow" '(org-refile :wk "refile")
  )

;; theme & dictionary
(leader-key
  "t" '(:ignore t :wk "theme & dictionary")
  "tt" '(consult-theme :wk "theme")
  "tr" '(youdao-dictionary-search-at-point-posframe :wk "yodao at point")
  "tR" '(youdao-dictionary-search-from-input :wk "youdao input")
  )

;; help
(leader-key
  "h" '(:ignore t :wk "help")
  "hh" '(helpful-callable :wk "callable")
  "hc" '(helpful-command :wk "command")
  "ha" '(consult-apropos :wk "apropos")
  "hf" '(helpful-function :wk "function")
  "hi" '(consult-man :wk "man")
  "hk" '(helpful-key :wk "key")
  "hm" '(helpful-macro :wk "macro")
  "hv" '(helpful-variable :wk "variable")
  "hs" '(helpful-symbol :wk "symbol")
  "h." '(helpful-at-point :wk "point")
  )

;; emacs & package
(leader-key
  "q" '(:ignore t :wk "emacs")
  "qq" '(save-buffers-kill-emacs :wk "quit") ;; 退出
  "qr" '(restart-emacs :wk "restart") ;; 重启
  "qu" '(upgrade-packages :wk "upgrade pkgs") ;; 更新包
  "qo" '(pomidor :wk "pomidor") ;; 番茄计时间
  "qb" '(type-break :wk "break") ;; 休息打断
  "qw" '(webjump :wk "wbjump") ;; 跳转浏览器
  )

(provide 'init-binding)
;;; init-binding.el ends here
